<template>
  <div>
    <van-image
      width="100%"
      height="100%"
      fit="contain"
      src="http://liufusong.top:8080/img/profile/bg.png"
    />
    <div class="box">
      <div class="img">
        <van-image
          class="image"
          round
          width="18vw"
          height="18vw"
          src="http://liufusong.top:8080/img/profile/avatar.png"
        />
      </div>
      <span>游客</span>
      <router-link class="link" to="/login">去登录</router-link>
    </div>
    <van-grid :column-num="3" class="grid" :border="false">
      <van-grid-item icon="star-o" text="我的收藏" to="/collect" />
      <van-grid-item icon="wap-home-o" text="我的出租" to="/gorent" />
      <van-grid-item icon="clock-o" text="看房记录" />
      <van-grid-item icon="idcard" text="成为房主" />
      <van-grid-item icon="contact" text="个人资料" />
      <van-grid-item icon="service-o" text="联系我们" />
    </van-grid>
    <van-image
      class="vanimg"
      width="90%"
      fit="contain"
      src="http://liufusong.top:8080/img/profile/join.png"
    />
  </div>
</template>

<script>
import { getUserInfo } from '@/api/user'
export default {
  name: 'My',
  props: {},
  async created () {
    const data = await getUserInfo()
    console.log(data)
  }
}
</script>

<style scoped lang="less">
.box {
  position: absolute;
  margin-left: 10%;
  margin-top: -15%;
  width: 80%;
  height: 45vw;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 10px 3px #ddd;

  .link {
    display: block;
    width: 25vw;
    height: 8vw;
    color: #fff;
    background-color: #21b97a;
    border-radius: 2vw;
    text-align: center;
    line-height: 8vw;
    font-size: 4vw;
    margin-top: 5vw;
  }
  .img {
    width: 22vw;
    height: 22vw;
    position: absolute;
    margin-top: -55%;
    text-align: center;
    line-height: 22vw;
    border-radius: 50%;
    background-color: #f5f5f5;
    .image {
      margin-top: 8%;
    }
  }
}
.grid {
  // position: absolute;
  margin-top: 35%;
}
.vanimg {
  margin-top: 5%;
  margin-left: 5%;
}
</style>
